<?php
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
// DLMan by Shedd Technologies International		  				//
// http://www.dlman.com | info@dlman.com							//
// Copyright 2003 by STI, All rights reserved.						//
// ---------------------------------------------------------------- //
// Usage of this software is governed by the terms of GPL. 	    	//
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//

/*
View License Data for a Record.
*/
require_once("global.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>View License Data</title>
<style type="text/css">
<!--
.prefinput{
	color: #333333;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight: normal;
	border-color: #333333;
	text-indent: 2px; 
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px; 
	background: #f8f8f8;
}
.button {
	background-color: #F8F8F8;
	color: #333333;
	border-color: black;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 11px;
	font-weight : bold;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px; 
}
-->
</style>
</head>
<body>
<?php
//get log data
$sql="SELECT * FROM ".$config->dt['log']." WHERE record_id='$record'";
$result=@mysql_query($sql);
$value=@mysql_fetch_array($result);
//get transaction
$sql="SELECT * FROM ".$config->dt['transactions']." WHERE txn_id='".$value['txn_id']."'";
$result=@mysql_query($sql);
$trans=@mysql_fetch_array($result);
//get username from id
$s="SELECT * FROM ".$config->dt['user']." WHERE ".$config->field['userid']."='".$value['user_id']."'";
$r=@mysql_query($s);
$v=@mysql_fetch_array($r);
//get product name from id
$sql="SELECT * FROM ".$config->dt['files']." WHERE id='".$value['file_id']."'";
$result=@mysql_query($sql);
$v2=@mysql_fetch_array($result);
//get license info
$sql="SELECT * FROM ".$config->dt['license']." WHERE id='".$v2['license']."'";
$result=@mysql_query($sql);
$lic=@mysql_fetch_array($result);
//get license data
$sql="SELECT * FROM ".$config->dt['license_data']." WHERE txn_id='".$value['txn_id']."'";
$result=@mysql_query($sql);
$licdata=@mysql_fetch_array($result);
?>
<b>License Data (Record #: <?php print $record; ?>)</b>
<br>
Transaction:&nbsp;<?php print $value['txn_id']; ?><br>
File:&nbsp;<?php print $v2['name']; ?><br>
Username:&nbsp;<?php print $v['username']; ?><br>
Purchase Date:&nbsp;<?php print date("F j, Y (H:i:s)",$trans['timestamp']); ?><br>
Log Record Creation (Download) Date:&nbsp;<?php print date("F j, Y (H:i:s)",$value['timestamp']); ?><br>
License:&nbsp;<?php print $lic['title']; ?><br>
<br><br>
<?php
for($i=1;$i<=5;$i++){
	print $lic['name_'.$i];
	print ":&nbsp;";
	print $licdata['data_'.$i];
	print "<br>";
}
?>
</body>
</html>
